#pragma once
#define DGGS_FIELDPYRAMID_EXPORTS

#ifdef _MSC_VER
#ifdef DGGS_FIELDPYRAMID_EXPORTS
#define DGGS_FIELDPYRAMID_API __declspec(dllexport)
#else
#define DGGS_FIELDPYRAMID_API __declspec(dllimport)
#endif
#else   // Linux GCC
#define DGGS_FIELDPYRAMID_API
#endif


#include"FieldPyramidDefine.hpp"


_NNU_DGGS_BEGIN

    using namespace Base;
    namespace FieldPyramid{

        /// <summary>
        /// դ����Ƭ�����ӿ�
        /// </summary>
        _DGGS_Interface IFieldPyramidKernel
        {
            /// <summary>
            /// ��ʼ��
            /// </summary>
            /// <param name="pyramidSet">��ֱ��ʲ���</param>
            virtual void init(FieldPyramidSet &pyramidSet)=0;

            /// <summary>
            /// �ͷ��ڴ�
            /// </summary>
            virtual void release()=0;

            /// <summary>
            /// ��ȡָ���㼶�ڵ�ǰ��Χ�ڵ�������Ƭ
            /// </summary>
            /// <param name="level">�㼶</param>
            /// <param name="spaceBBox">�ռ䷶Χ</param>
            /// <param name="tileCodes">��Ƭ������</param>
            /// <param name="tileCount">��Ƭ����</param>
            /// /// <returns></returns>
            virtual bool getTileCodes(DGGSSpaceBBox spaceBBox,int level,DGGSTileCode *&tileCodes,int & tileCount)=0;

            /// <summary>
            /// ������Ƭ�����ȡ��Ƭ�Ŀռ䷶Χ
            /// </summary>
            /// <param name="tileCodes">��Ƭ����</param>
            /// <param name="spaceBBox">�ռ䷶Χ</param>
            /// <returns></returns>
            virtual bool getTileSpaceBound(DGGSTileCode tileCode,DGGSSpaceBBox &spaceBBox)=0;

            /// <summary>
            /// ������Ƭ�����ȡ��Ƭ�ĸ�����Χ
            /// </summary>
            /// <param name="tileCodes">��Ƭ����</param>
            /// <param name="tileBound">������Χ�з�Χ</param>
            /// <returns></returns>
            virtual bool getTileGridBound(DGGSTileCode tileCode, DGGridBBox &gridBBox)=0;

            /// <summary>
            /// ��������ת��Ƭ����
            /// </summary>
            /// <param name="elementCode">��������</param>
            /// <param name="tileCode">��Ƭ����</param>
            /// <returns></returns>
            virtual bool gridCodeToTileCode(DGGSElementCode elementCode, DGGSTileCode &tileCode)=0;

            /// <summary>
            /// ���˲�ѯ
            /// </summary>
            /// <param name="topoType">��Ƭ��������</param>
            /// <param name="tileCode">��Ƭ����</param>
            /// <param name="result">���</param>
            /// <param name="resultCount">�������</param>
            /// <returns></returns>
            virtual bool query(DGGSTileTopoType topoType,DGGSTileCode tileCode,DGGSTileCode *&result,int &resultCount)=0;
        };


        /// <summary>
        /// ����FieldPyramidKernel�����
        /// </summary>
        /// <param name="pyramidSet">��ֱ��ʲ���</param>
        /// <returns></returns>
        extern "C" DGGS_FIELDPYRAMID_API IFieldPyramidKernel* CreateFieldPyramidObj(FieldPyramidSet pyramidSet);


        /// <summary>
        /// ����FieldPyramidKernel�����
        /// </summary>
        /// <param name="pFieldPyramid">��ֱ��ʶ���</param>
        extern "C" DGGS_FIELDPYRAMID_API  void DestroyFieldPyramidObj(IFieldPyramidKernel * &pFieldPyramid);
    }

_NNU_DGGS_END